package org.example.tialsproject.mapper;

import org.apache.ibatis.annotations.*;
import org.example.tialsproject.pojo.Dept;

import java.util.List;

@Mapper
public interface DeptMapper {
    @Select("select * from dept")
    public List<Dept> getAllDepts();

    @Delete("delete from dept where id=#{id}")
    public void deleteDept(int id);

    @Insert("insert into dept (name,create_time,update_time) values (#{name},#{createTime},#{updateTime})")
    public void addDept(Dept dept);

    @Select("select * from dept where id=#{id}")
    public Dept getDeptDetail(int id);

    @Update("update dept set name=#{name},create_time=#{createTime},update_time=#{updateTime} where id=#{id}")
    public void updateDept(Dept dept);



}
